﻿@page "/AddMenu"
@using BootstrapBlazor.Components;
@using Foo = BlazorOrdering.Core.BoMenu;


<h3>添加菜谱</h3>

<GroupBox Title="已经增加">

    <Table TItem="Foo" Items="@meunlist">
        <TableColumns>
            <TableColumn @bind-Field="@context.Day" FormatString="yyyy年MM月dd日 dddd"/>
            <TableColumn @bind-Field="@context.Type" />
            <TableColumn @bind-Field="@context.Name" />
            <TableColumn @bind-Field="@context.Price" />
        </TableColumns>
    </Table>
</GroupBox>

    <div class="form-demo">
        <ValidateForm class="form-inline" Model="@bomenu" OnInvalidSubmit="@OnInvalidSubmit1" OnValidSubmit="@OnValidSubmit">
            <div class="row">
                <div class="form-group col-12">
                    <DateTimePicker @bind-Value="@bomenu.Day"
                                    Format="MM月dd日 dddd" />


                </div>

                <div class="form-group col-12">
                    <Select TValue="string" Items="@Items" @bind-Value="@bomenu.Type"></Select>

                </div>
                <div class="form-group col-12">
                    <BootstrapInput @bind-Value="@bomenu.Name" />

                </div>
                <div class="form-group col-12">
                    <BootstrapInputNumber @bind-Value="@bomenu.Price" />
                </div>
                <div class="form-group col-12">
                    <Button ButtonType="ButtonType.Submit" Text="保存" />
                </div>
            </div>
        </ValidateForm>

        <Message @ref="MessageElement" />

    </div>

    @code{
        public List<BlazorOrdering.Core.BoMenu> meunlist { get; set; }
    }
